All Questions
Tagged with clean-architectureonion-architecture
18 questions
0votes
3answers
372views
Repository interfaces returning DTO in clean architecture used by query handlers
Repository interfaces are often defined in the Domain layer. This makes sense for command handlers, which call repository methods and return nothing. But what about query handlers that call repository ...
2votes
2answers
250views
How to handle pagination logic in a layered architecture without making premature decisions?
I'm working with a layered architecture and I'm unsure where to place the pagination logic. This answer suggests that it's not a domain concern, which I think makes sense. In most cases, pagination ...
2votes
1answer
132views
Should our api-response-to-domain-entity transform functions be in the API/Infrastructure layer, or the Domain layer?
Should our api-response-to-domain-entity transform functions be in the API/Infrastructure layer, or the Domain layer? We have a react-native mobile application written in TypeScript. We have separated ...
1vote
1answer
447views
Onion Architecture: Where to put Hangfire specific logic
We have a .net core app with the following folder / onion structure: WidgetApp -> Core -> Application -> JobAutoStarter -> JobAutoStarter.cs WidgetApp -> Core -> Domain -> ...
1vote
1answer
190views
deciding where to put "formatting" logic - database or in application layer
We have an application that fetches user data from an Azure tenant via MS Graph. We need to distinguish between guests and regular members. Guests come back with Usernames that look like this: ...
1vote
2answers
375views
Where to save entity metadata in a Ports-And-Adapters Architecture
I’m using a hexagonal/clean/ports-and-adapter architecture. For the sake of simplicity, I’ll only talk about domain and infrastructure here, where the infrastructure has dependencies on the domain but ...
1vote
3answers
9kviews
Mapping to and from domain entities
I am in the process of implementing onion / clean architecture, and would like to understand better how and when to map to my domain entities. So if we take a specific example where we have a Post and ...
1vote
2answers
743views
Catch "foreign" exception in adapter and convert them in own business exception is a good practice?
I am currently thinking about some design choices regarding exception handling. My current architecture looks a little like this: You can see that I have a UI where a try-catch middleware is cathing ...
1vote
1answer
984views
How do proto models in gRPC fit into Clean Architecture
I know they say that clean architecture are guidelines, and individual projects will affect implementation, but is there a general thought on the correct implementation? A lot of times I see DTO ...
0votes
3answers
2kviews
Do adapters get only called by usecases?
Suppose we have a layered architecture like onion architecture or clean architecture with three modules representing each layer: domain.py usecase.py databaseadapter.py The domain layer contains the ...
0votes
1answer
170views
Mutli tenant app with onion architecture and multiple presentations
Currently I started designing a new multi tenant SaaS application based on the onion architecture in C# Using a rest web API to expose my services and consume them on 3 platforms. Two web apps (one ...
1vote
2answers
2kviews
How to organize database access logic for the infrastructure and application layer when avoiding ORM tools?
I'm trying create a .NET Core project and followed some guides to create a basic architecture Jason Taylor - Clean Architecture with ASP.NET Core 3.0 Sample project Clean Architecture Template I'm not ...
-3votes
1answer
359views
What is the simplest version of best practice application architecture for a backend in C# and ASP.NET Core WebAPI?
I know that in some contexts, best practice would be DDD, CQRS and EventSourcing, but in my case this would be too complicated of two reasons: My team is beginners, and we want them to be productive ...
1vote
1answer
385views
Define input and output interfaces for each application layer
I want to create a multi-layered backend architecture with a REST layer and GraphQL layer later on. So let's say you would start with the basic layers controller, service, repository would it make ...
6votes
3answers
557views
Where to convert primitive types in meaningful types in Clean Architecture / Onion Architecture
The book "Implementing Domain Driven Design" (page 361) suggests to use special types to distinguish several kinds of IDs, e. g. using BookId(1) instead of just 1 of type Int or Long. In my Clean ...